#include <stdio.h>
int main (void)
{
	int i,n,num;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&num);
		int j,x;
		x=0;
		for(j=1;j<=num;j++)
		{
			if((num%j==0)&&(j%2==0))
			{
				printf("%d ",j);
				x++;
			}
	    }
	    if(x==0)
		printf ("%d has no even factors",num);
		printf ("\n");
	}
	return 0;
}
